package com.lw.ai.model;////

import lombok.AllArgsConstructor;
import lombok.Data;
@Data
@AllArgsConstructor
public class Result<T> {
    private Integer code;
    private String message;
    private T data;
    private String dataType;

    public static <T> Result<T> success(T data) {
        return new Result<>(200, "success", data, data == null ? "null" : data.getClass().getSimpleName());
    }

    public static <T> Result<T> failure(Integer code, String message) {
        return new Result<>(code, message, null, null);
    }
}

